/**
 * Created by Dalyn on 2017/3/14.
 */
import Relay from "react-relay";

export default class OrderTradeListMutation extends Relay.Mutation {

    static fragments = {};

    getMutation() {
        return Relay.QL`mutation { orderTradeList }`;
    }

    getVariables() {
        return {
            argsInput: {
                pageNum: this.props.pageNum,
                pageSize: this.props.pageSize,
                status: this.props.status,
                contractId:this.props.contractId,
                startDate:this.props.startDate,
				endDate:this.props.endDate,
                enId:this.props.enId
            }
        };
    }

    getFatQuery() {
        return Relay.QL`fragment on orderTradeListPayload {
            orderTradeList {  
                errorCode
                value
                totalResult
                id
                orders{
                    createDate
                    account
                    contractId
                    enId
                    purchaseAccount
                    profitAccount
                    status
                    oid
                    signedContract
                }
            }
        }`;
    }

    getConfigs() {
        return [{
            type: 'REQUIRED_CHILDREN',
            children: [Relay.QL`
                fragment on orderTradeListPayload {
                    orderTradeList {
                        errorCode
                        value
                        totalResult
                        id
                        orders{
							createDate
							account
							contractId
							enId
							purchaseAccount
							profitAccount
							status
							oid
							signedContract
						}
                    }
                }
            `]
        }];
    }

}